$(function () {
    getServiceType();
});

function getServiceType() {
    let result = myAjax('/roomDetails', 'get', {});
    // console.log(result);
    let data = result.list;
    let html = "";
    for (let i = 0; i < data.length; i++) {
        html += ' <div onclick="jump(' + data[i].id + ')">\n' +
            '     <div>' + data[i].serviceType + '</div>\n' +
            '     </div>';
    }
    $("#serviceType").html(html)
}

function jump(id) {
    localStorage.setItem("typeId", id);
    //sessionStorage.setItem("userId",id);   本地存储  两种方式都可以
    window.open("/html/service.html");//页面跳转
}

